<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%String urlEx=request.getPathInfo().toString().replaceAll("/","");%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@page import="it.cpyx.appengine.server.data.LabelData"%>
<%@page import="it.cpyx.appengine.server.data.utils.LabelDataUtils"%>
<%@page import="java.util.Iterator"%>
<%@page import="it.cpyx.appengine.server.data.TextData"%>
<%@page import="it.cpyx.appengine.server.data.utils.TextDataUtils"%>
<%@page import="com.google.appengine.api.users.UserServiceFactory"%>
<%@page import="com.google.appengine.api.users.UserService"%>
<%@page import="com.google.appengine.api.users.User"%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Tags:</title>
</head>
<body>
	<a href="/">home</a>
		<hr>
<%
	UserService userService = UserServiceFactory.getUserService();
    User user = userService.getCurrentUser();
    if (user != null) {
%>
		<p>Hello, <%=user.getNickname()%>! (You can <a href="<%=userService.createLogoutURL(request.getRequestURI())%>">sign out</a>.)</p>
<%
	} else {
%>
		<p>Hello! <a href="<%=userService.createLoginURL(request.getRequestURI())%>">Sign in</a>.</p>
<%
	}
%><hr>
<b>Tags</b><br>
<hr>
<%
LabelData l=LabelDataUtils.getByUrlExtension(urlEx);

if(l!=null){
	%>texts:<hr><%
	Iterator it = l.getTextDataList().iterator();
	while (it.hasNext()) {
		
		Object element = it.next();
		TextData t2=TextDataUtils.getById(Long.parseLong(element.toString()));
		if(t2.getPass()==null){
			%> <br><a href="/<%=t2.getUrlExtension() %>"><%=t2.getUrlExtension() %></a> <%
		}
	}
	
	
}else{
	%>Nothing Found!!!<%
}
%>
</body>
</html>